/**
 * Calculate the divisors of a given number
 * 
 * @author Jon Ludwig
 *
 */

import java.math.*;
import java.util.*;

public class Divisors {
	
	/**
	 * Calculate the divisors of a
	 * @param a
	 * @return
	 */
	public static ArrayList<BigInteger> divisors(BigInteger a)
	{
		ArrayList<BigInteger> divs = new ArrayList<BigInteger>();
		BigInteger max = new BigInteger(String.valueOf((int)Math.sqrt(a.doubleValue())));  // messy?
		
		for (BigInteger i = BigInteger.ONE; i.compareTo(max) < 0; i = i.add(BigInteger.ONE))
		{
			if (a.remainder(i).compareTo(BigInteger.ZERO) == 0)
			{
				// divides evenly
				divs.add(i);
				divs.add(a.divide(i));
			}
		}
		
		// check perfect square
		if (max.pow(2).compareTo(a) == 0)
			divs.add(max);
		
		return divs;
	}
	
	public static void main(String[] args) {
		if (args.length < 1) {
			System.out.println();
			return;
		}
		
		ArrayList<BigInteger> divs = divisors(new BigInteger(args[0]));
		
		for (BigInteger div : divs)
			System.out.println(div);
	}

}
